﻿using System;
using UnityEngine;

namespace ParticlePlayground
{
	// Token: 0x02000163 RID: 355
	[Serializable]
	public class Vector3AnimationCurveC
	{
		// Token: 0x0600084F RID: 2127 RVA: 0x000312E0 File Offset: 0x0002F4E0
		public virtual Vector3 Evaluate(float time)
		{
			return this.Evaluate(time, 1f);
		}

		// Token: 0x06000850 RID: 2128 RVA: 0x000312F0 File Offset: 0x0002F4F0
		public virtual Vector3 Evaluate(float time, float scale)
		{
			return new Vector3(this.x.Evaluate(time * this.xRepeat % 1f), this.y.Evaluate(time * this.yRepeat % 1f), this.z.Evaluate(time * this.zRepeat % 1f)) * scale;
		}

		// Token: 0x06000851 RID: 2129 RVA: 0x00031354 File Offset: 0x0002F554
		public virtual bool HasKeys()
		{
			this.CheckNull();
			return this.x.keys.Length > 0 || this.y.keys.Length > 0 || this.z.keys.Length > 0;
		}

		// Token: 0x06000852 RID: 2130 RVA: 0x000313A0 File Offset: 0x0002F5A0
		public virtual void SetKeyValues(int key, float value)
		{
			this.SetKeyValues(key, new Vector3(value, value, value), 0f, 0f);
		}

		// Token: 0x06000853 RID: 2131 RVA: 0x000313BC File Offset: 0x0002F5BC
		public virtual void SetKeyValues(int key, Vector3 value, float inTangent, float outTangent)
		{
			this.CheckNull();
			Keyframe[] keys = this.x.keys;
			Keyframe[] keys2 = this.y.keys;
			Keyframe[] keys3 = this.z.keys;
			if (key < this.x.keys.Length)
			{
				keys[key].value = value.x;
				keys[key].inTangent = inTangent;
				keys[key].outTangent = outTangent;
			}
			if (key < this.y.keys.Length)
			{
				keys2[key].value = value.y;
				keys2[key].inTangent = inTangent;
				keys2[key].outTangent = outTangent;
			}
			if (key < this.z.keys.Length)
			{
				keys3[key].value = value.z;
				keys3[key].inTangent = inTangent;
				keys3[key].outTangent = outTangent;
			}
			this.x.keys = keys;
			this.y.keys = keys2;
			this.z.keys = keys3;
		}

		// Token: 0x06000854 RID: 2132 RVA: 0x000314DC File Offset: 0x0002F6DC
		public virtual void Reset()
		{
			this.CheckNull();
			Keyframe[] array = new Keyframe[2];
			array[0].time = 0f;
			array[1].time = 1f;
			this.x.keys = array;
			this.y.keys = array;
			this.z.keys = array;
			this.xRepeat = 1f;
			this.yRepeat = 1f;
			this.zRepeat = 1f;
		}

		// Token: 0x06000855 RID: 2133 RVA: 0x00031560 File Offset: 0x0002F760
		public virtual void Reset1()
		{
			this.CheckNull();
			Keyframe[] array = new Keyframe[2];
			array[0].time = 0f;
			array[0].value = 1f;
			array[1].time = 1f;
			array[1].value = 1f;
			this.x.keys = array;
			this.y.keys = array;
			this.z.keys = array;
			this.xRepeat = 1f;
			this.yRepeat = 1f;
			this.zRepeat = 1f;
		}

		// Token: 0x06000856 RID: 2134 RVA: 0x00031604 File Offset: 0x0002F804
		public virtual void ResetWithMidKey()
		{
			this.CheckNull();
			Keyframe[] array = new Keyframe[3];
			array[0].time = 0f;
			array[1].time = 0.5f;
			array[2].time = 1f;
			this.x.keys = array;
			this.y.keys = array;
			this.z.keys = array;
			this.xRepeat = 1f;
			this.yRepeat = 1f;
			this.zRepeat = 1f;
		}

		// Token: 0x06000857 RID: 2135 RVA: 0x00031698 File Offset: 0x0002F898
		public virtual void CheckNull()
		{
			if (this.x == null)
			{
				this.x = new AnimationCurve();
			}
			if (this.y == null)
			{
				this.y = new AnimationCurve();
			}
			if (this.z == null)
			{
				this.z = new AnimationCurve();
			}
		}

		// Token: 0x06000858 RID: 2136 RVA: 0x000316E8 File Offset: 0x0002F8E8
		public virtual Vector3AnimationCurveC Clone()
		{
			return new Vector3AnimationCurveC
			{
				x = new AnimationCurve(this.x.keys),
				y = new AnimationCurve(this.y.keys),
				z = new AnimationCurve(this.z.keys),
				xRepeat = this.xRepeat,
				yRepeat = this.yRepeat,
				zRepeat = this.zRepeat
			};
		}

		// Token: 0x0400084A RID: 2122
		public AnimationCurve x;

		// Token: 0x0400084B RID: 2123
		public AnimationCurve y;

		// Token: 0x0400084C RID: 2124
		public AnimationCurve z;

		// Token: 0x0400084D RID: 2125
		public float xRepeat = 1f;

		// Token: 0x0400084E RID: 2126
		public float yRepeat = 1f;

		// Token: 0x0400084F RID: 2127
		public float zRepeat = 1f;
	}
}
